import request from '@/config/axios'
import type { Dayjs } from 'dayjs'

/** 会员皮肤状态分析请求信息 */
export interface FaceanalyseRequest {
  id: number // 主键
  userId: number // 用户ID
  apiKey: string // apiKey
  apiSecret: string // ap秘钥
  requestType: string // 请求类型（url,base64,file）
  imageUrl: string // 正面图
  leftSideImageUrl: string // 左侧图
  rightSideImageUrl: string // 右侧图
  returnMaps: string // 需要返回的皮肤问题检测图谱图片类型
  returnMarks: string // 需要返回的皮肤问题检测图谱图片类型
  roiOutlineColor: string // 绘制颜色
  returnSideResults: string // 需要返回的侧脸信息
  mark: string // 会员备注
}

// 会员皮肤状态分析请求 API
export const FaceanalyseRequestApi = {
  // 查询会员皮肤状态分析请求分页
  getFaceanalyseRequestPage: async (params: any) => {
    return await request.get({ url: `/member/faceanalyse-request/page`, params })
  },

  // 查询会员皮肤状态分析请求详情
  getFaceanalyseRequest: async (id: number) => {
    return await request.get({ url: `/member/faceanalyse-request/get?id=` + id })
  },

  // 新增会员皮肤状态分析请求
  createFaceanalyseRequest: async (data: FaceanalyseRequest) => {
    return await request.post({ url: `/member/faceanalyse-request/create`, data })
  },

  // 修改会员皮肤状态分析请求
  updateFaceanalyseRequest: async (data: FaceanalyseRequest) => {
    return await request.put({ url: `/member/faceanalyse-request/update`, data })
  },

  // 删除会员皮肤状态分析请求
  deleteFaceanalyseRequest: async (id: number) => {
    return await request.delete({ url: `/member/faceanalyse-request/delete?id=` + id })
  },

  /** 批量删除会员皮肤状态分析请求 */
  deleteFaceanalyseRequestList: async (ids: number[]) => {
    return await request.delete({
      url: `/member/faceanalyse-request/delete-list?ids=${ids.join(',')}`
    })
  },

  // 导出会员皮肤状态分析请求 Excel
  exportFaceanalyseRequest: async (params) => {
    return await request.download({ url: `/member/faceanalyse-request/export-excel`, params })
  }
}
